fix: hide domainList when loginDomain is disabled (fixes #220) #222
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description / 问题描述
Fixes #220 - When
loginDomainsetting is disabled (= 1), the/api/setting/websiteConfigAPI was still returning the fulldomainListarray, exposing domain information to clients even when the admin explicitly chose not to show domains in the login form.Changes / 修改内容
Modified
mail-worker/src/service/setting-service.js:websiteConfigfunction now conditionally returnsdomainListbased on theloginDomainsettingloginDomain === 0(enabled): Returns the full domain listloginDomain !== 0(disabled): Returns an empty array[]Before / 之前
After / 之后
Testing / 测试
This change aligns the API behavior with the frontend behavior where the domain selector is only shown when
loginDomain === 0(seemail-vue/src/views/login/index.vueline 19).This is a minimal, targeted fix that prevents information disclosure while maintaining backward compatibility for users who have
loginDomainenabled.